<?xml version="1.0"?>
<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database">
  <database name="default" defaultIdMethod="none">
    <table name="C_PROJECT">
      <column name="C_PROJECT_ID" primaryKey="true" required="true" type="ID" size="10" autoIncrement="false"/>
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" default="Y" autoIncrement="false"/>
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" default="CURRENT_TIMESTAMP" autoIncrement="false"/>
      <column name="CREATEDBY" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" default="CURRENT_TIMESTAMP" autoIncrement="false"/>
      <column name="UPDATEDBY" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
      <column name="VALUE" primaryKey="false" required="true" type="VARCHAR" size="40" autoIncrement="false"/>
      <column name="NAME" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false"/>
      <column name="DESCRIPTION" primaryKey="false" required="false" type="VARCHAR" size="255" autoIncrement="false"/>
      <column name="NOTE" primaryKey="false" required="false" type="VARCHAR" size="2000" autoIncrement="false"/>
      <column name="ISSUMMARY" primaryKey="false" required="true" type="CHAR" size="1" default="N" autoIncrement="false"/>
      <column name="AD_USER_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="C_BPARTNER_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="C_BPARTNER_LOCATION_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="POREFERENCE" primaryKey="false" required="false" type="VARCHAR" size="20" autoIncrement="false"/>
      <column name="C_PAYMENTTERM_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="C_CURRENCY_ID" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
      <column name="M_PRICELIST_VERSION_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="C_CAMPAIGN_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="ISCOMMITMENT" primaryKey="false" required="true" type="CHAR" size="1" default="Y" autoIncrement="false"/>
      <column name="PLANNEDAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
      <column name="PLANNEDQTY" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
      <column name="PLANNEDMARGINAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
      <column name="COMMITTEDAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
      <column name="DATECONTRACT" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false"/>
      <column name="DATEFINISH" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false"/>
      <column name="GENERATETO" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false"/>
      <column name="PROCESSED" primaryKey="false" required="true" type="CHAR" size="1" default="N" autoIncrement="false"/>
      <column name="SALESREP_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="COPYFROM" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false"/>
      <column name="C_PROJECTTYPE_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="COMMITTEDQTY" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
      <column name="INVOICEDAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
      <column name="INVOICEDQTY" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
      <column name="PROJECTBALANCEAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
      <column name="C_PHASE_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="ISCOMMITCEILING" primaryKey="false" required="true" type="CHAR" size="1" default="N" autoIncrement="false"/>
      <column name="M_WAREHOUSE_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="PROJECTCATEGORY" primaryKey="false" required="false" type="CHAR" size="1" default="N" autoIncrement="false"/>
      <column name="PROCESSING" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false"/>
      <column name="C_BPARTNERSR_ID" primaryKey="false" required="false" type="ID" size="10" autoIncrement="false"/>
      <column name="PROJINVOICERULE" primaryKey="false" required="true" type="CHAR" size="1" default="-" autoIncrement="false"/>
      <column name="PROJECTLINELEVEL" primaryKey="false" required="true" type="CHAR" size="1" default="P" autoIncrement="false"/>
      <foreign-key foreignTable="AD_CLIENT" name="ADCLIENT_CPROJECT" onDelete="none">
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_ORG" name="ADORG_CPROJECT" onDelete="none">
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_USER" name="ADUSER_SR_CPROJECT" onDelete="none">
        <reference local="SALESREP_ID" foreign="AD_USER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_USER" name="ADUSER_CPROJECT" onDelete="setnull">
        <reference local="AD_USER_ID" foreign="AD_USER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_BPARTNER" name="CBPARTNER_CPROJECT" onDelete="none">
        <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_BPARTNER_LOCATION" name="CBPLOCATION_CPROJECT" onDelete="none">
        <reference local="C_BPARTNER_LOCATION_ID" foreign="C_BPARTNER_LOCATION_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_CAMPAIGN" name="CCAMPAIGN_CPROJECT" onDelete="none">
        <reference local="C_CAMPAIGN_ID" foreign="C_CAMPAIGN_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_CURRENCY" name="CCURRENCY_CPROJECT" onDelete="none">
        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_PAYMENTTERM" name="CPAYMENTTERM_CPROJECT" onDelete="none">
        <reference local="C_PAYMENTTERM_ID" foreign="C_PAYMENTTERM_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_PHASE" name="CPHASE_CPROJECT" onDelete="none">
        <reference local="C_PHASE_ID" foreign="C_PHASE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_PROJECTTYPE" name="CPROJECTTYPE_CPROJECT" onDelete="none">
        <reference local="C_PROJECTTYPE_ID" foreign="C_PROJECTTYPE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_PRICELIST_VERSION" name="MPRICELISTVERSION_CPROJECT" onDelete="none">
        <reference local="M_PRICELIST_VERSION_ID" foreign="M_PRICELIST_VERSION_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_WAREHOUSE" name="MWAREHOUSE_CPROJECT" onDelete="none">
        <reference local="M_WAREHOUSE_ID" foreign="M_WAREHOUSE_ID"/>
      </foreign-key>
      <unique name="C_PROJECT_VALUE">
        <unique-column name="AD_CLIENT_ID"/>
        <unique-column name="VALUE"/>
      </unique>
      <check>
        <rule><![CDATA[IsActive in ('Y','N')]]></rule>
      </check>
      <check>
        <rule><![CDATA[IsCommitment in ('Y','N')]]></rule>
      </check>
      <check>
        <rule><![CDATA[GenerateTo in ('Y','N')]]></rule>
      </check>
      <check>
        <rule><![CDATA[Processed in ('Y','N')]]></rule>
      </check>
    </table>
  </database>
